<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery\jquery.js"></script>
</head>
<body>
    <div>
        <p id="#target">文本一</p>
        <span id="target">文本二</span>
    </div>
    <script>
        $(function(){
            $("div").find("#"+$.escapeSelector("#target")).css("color","red");
        })
    </script>
</body>
</html>